POV-Ray : Newsgroups : povray.advanced-users : cubic splines : Re: cubic splines Server Time
29 Jul 2024 10:27:20 EDT (-0400)
  Re: cubic splines  
From:
Date: 17 May 2002 11:35:24
Message: <qr7aeugkvt07m6obnchs3hben663jbnkit@4ax.com>
On Fri, 17 May 2002 11:18:10 -0400, "Christopher Johnson"
<age### [at] hotmailcom> wrote:

> It's not really an analytical solution.  You pass a spline to the macro and
> it creates a reference spline.

If I understand it correctly it is similiar to my idea. Look below:

#macro Spline_With_Linear_Movement(Spline,Min,Max,Accuracy)
  spline{
    #local Last=Spline(Min);
    #local Length=0;
    #local C=Min;
    #while (C<=Max)
      #local C=min(C,Max);
      #local Point=Spline(C);
      #local Length=Length+vlength(Point-Last);
      Length , Point
      #local C=C+Accuracy;
    #end
  }
#end

#macro Time_To_Length_Converter(Spline,Min,Max,Accuracy)
  #local Conversion=function{spline{
    #local Last=Spline(Min);
    #local Length=0;
    #local C=Min;
    #while (C<=Max)
      #local C=min(C,Max);
      #local Point=Spline(C);
      #local Length=Length+vlength(Point-Last);
      C , Length
      #local C=C+Accuracy;
    #end
  }};
  function(T){Conversion(T).x}
#end

ABX


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.